import Books.BooksList;
import User.User;
import User.UserAdmin;
import User.UserNormal;

import java.util.Scanner;

public class Main {


    public static User Login(){
        System.out.println("请输入你的名字：");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("请输入你的身份：1.管理员  2.普通用户");
        int cmp = scanner.nextInt();
        if(cmp == 1){
            return new UserAdmin(name);
        }else {
            return new UserNormal(name);
        }
    }

    public static void main(String[] args) {
        User user = Login();
        BooksList booksList = new BooksList();

        while (true){
            int cmp = user.meun();
            user.doOperations(cmp,booksList);
        }
    }
}
